package com.example.k8s.hello.common.exception;

public class BizException extends RuntimeException {
    private String code;

    public BizException() {
        super();
    }

    public BizException(String code) {
        super(String.valueOf(code));
        this.code = code;
    }

    public BizException(String code, String message) {
        super(message);
        this.code = code;
    }

    public BizException(String code, String message, Throwable throwable) {
        super(message, throwable);
        this.code = code;
    }

    public BizException(ApiExEnum apiExEnum, Throwable throwable) {
        super(apiExEnum.summary, throwable);
        this.code = apiExEnum.name();
    }

    public String getCode() {
        return code;
    }
}
